/*
 * This is a trusted module. It runs in full page scope.
 */

//Set up the form submission for prefix menu retrieval.
var form = $('#threadtools_menu form[name="threadadminform"]');
var url = form.attr('action');
var formData = form.serialize() + '&do=editthread';

//Load prefix menu and status area.
$.post(url, formData , function(dom) {
	var menu = $('select[name="prefixid"]', dom);
	menu.attr('id', 'prefixMenu');
	menu.change(function() {
		var prefix = $(this).val();
		Thread.setPrefix(prefix, function() {
			$('#statusUpdate').show().fadeOut(3000);
		});
	});
	
	$('div[id^="post"]').first().prepend('<div id="reportBar">Report Status: </div>');
	$('#reportBar').append(menu);
	$('#reportBar').append('<span id="statusUpdate">&nbsp;&nbsp;Status Updated!</span>');
	$('#statusUpdate').hide();
	$('#statusUpdate').css('color', 'green');
});